﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using RBS.Web.API.Models;

namespace RBS.Web.API.Areas.User.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    public class FriendSearchController : ApiController
    {
        // GET api/friendsearch
        /// <summary>
        /// 查询好友
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public JsonData GetU_Friends(int id, string m, int type = 0)
        {
            var jsonData = new JsonData();
            var singers = new RBS.Core.BLL.U_User().GetModelList(" ( Mobile like '%" + m + "%'  and id <> '"+id+"')")
                .Select(a => new
                {
                    a.Id,
                    a.U_Uid,
                    a.Nick_Name,
                    a.U_Name,
                    a.Mobile,
                    a.Email,
                    a.QQ
                });
            jsonData.Data = singers;
            jsonData.Success = true;
            return jsonData;
        }
    }
}
